package com.orange.project.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.orange.common.base.service.impl.BaseServiceImpl;
import com.orange.project.base.mapper.UserMapper;
import com.orange.project.base.pojo.UserDto;
import com.orange.project.base.service.UserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@RequiredArgsConstructor
@Service
@Transactional(rollbackFor = Exception.class)
public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDto> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public UserDto getUserInfo(String account){
        LambdaQueryWrapper<UserDto> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UserDto::getAccount,account);
        return userMapper.selectOne(queryWrapper);
    }

}
